package com.example.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 设备操作记录表
 * @TableName device_operation
 */
@TableName(value ="device_operation")
@Data
public class DeviceOperation implements Serializable {
    /**
     * 记录ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 设备ID
     */
    @TableField(value = "device_id")
    private Long deviceId;

    /**
     * 操作用户ID
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 操作类型
     */
    @TableField(value = "operation")
    private String operation;

    /**
     * 操作值
     */
    @TableField(value = "value")
    private String value;

    /**
     * 操作结果(0-失败,1-成功)
     */
    @TableField(value = "result")
    private Integer result;

    /**
     * 操作时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "operation_time")
    private LocalDateTime operationTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}